import Vuex from 'vuex';
import Vue from 'vue';
Vue.use(Vuex);

export default new Vuex.Store({
    state: {
        token: localStorage.getItem('userToken'),
        IMISLOGIN: '',
    },
    getters: {

    },
    mutations: {
        disableLogin(state) {
            localStorage.removeItem('userToken');
        },
        getToken(state) {

            state.token = localStorage.getItem('userToken')
        },
        SET_IMLOGINSTATUS: (state, imIsLogin) => {
            state.IMISLOGIN = imIsLogin
        },
    },
    actions: {
        logOff: (context) => {
            context.commit('disableLogin');
        }
    }
});